<!-- Content Wrapper. Contains page content -->
<div class="box box-primary">
    <div class="box-header with-border">
        <h3 class="box-title">添加一篇文章吧</h3>
    </div>

    <form action="{:url('/index/imageup')}" method="post" target="_iframe" id="imageForm" enctype="multipart/form-data">
        <input type="file" name="image" id="imageInput">
        <button class="btn btn-github" onclick="imageup()">图片上传</button>
    </form>
    <form role="form" action="{:url('article/save')}" method="post" style="clear: both">

        <div class="form-group">
            <label for="title">标题</label>
            <input type="text" class="form-control" name="title" id="title" value="">
        </div>
        <div class="form-group">
            <label for="class">分类</label>
            <select name="class" id="class" class="form-control">
                {volist name="classList" id="class"}
                <option value="{$class.id}">{$class.name}</option>
                {/volist}
            </select>
        </div>
        <div class="form-group">
            {volist name="labelList" id="label"}
            <label>{$label.name}</label>
            <input type="checkbox" name="label[]" value="{$label.id}">
            {/volist}

        </div>
        <input type="hidden" name="_method" value="get">


        <textarea name="content">文章都不会写,怎么装逼?怎么撩妹?</textarea>

        <div class="box-footer">
            <button type="submit" class="btn btn-primary">确认</button>
        </div>
    </form>

</div>
{js href="/static/plugins/tinymce/js/tinymce/tinymce.min.js"}
<script>
    tinymce.init({
        selector: 'textarea',
        language: "zh_CN",
//        imageupload_url: '/my/uploader/path', // PHP (or other server side script)
        // imageupload_rel: 'http://cdn.somewhere.com/media/tinymce-plugin/imageupload', // use if not installed in plugin folder.
        plugins: [
            "link",
            "image"
        ]

    });
    $('#show').addClass('active');

    function imageup(data) {
        if(data.status){
            $('#mceu_12').click();
            $('#mceu_35-inp').val(data.info);
        }else {
            alert(data.info);
        }
    }
</script>
<iframe src="javascript:false;" name="_iframe" id="ifra" style="display: none;"></iframe>
